package com.lzh.eventdemo.controller;

import java.math.BigDecimal;
import java.text.MessageFormat;

/**
 * @Description:
 * @Author: LiuZiHao
 * @Date: 2022/10/9 15:59
 */
public class Test {
    public static void main(String[] args) {
        String s = "{0}/{1}";
        System.out.println(MessageFormat.format(s, "1234", "5"));

        String msg = "{0}{1}{2}{3}{4}{5}{6}{7}{8}";
        Object[] array = new Object[]{"A", "B", "C", "D", "E", "F", "G", "H", "I",};
        String value = MessageFormat.format(msg, array);
        System.out.println(value);// 输出：ABCDEFGHI
        int intValue = 6;
        double result = 1 / (double) intValue;
        String format = String.format("%.1f", result);// 33.33
        System.out.println("value = " + format);
        System.out.println(new BigDecimal(-100));
    }
}
